.chat-container {
  display: flex;
  height: calc(100vh - 94px);
  background-color: #f4f6f8;
}

.session-list {
  width: 260px;
  background-color: #fff;
  border-right: 1px solid #f1f1f1;
  padding: 20px;
  display: flex;
  flex-direction: column;

  .new-chat {
    margin-bottom: 15px;
    .el-button {
      width: 100%;
    }
  }

  .session-items {
    flex: 1;
    overflow-y: auto;
  }

  .session-item {
    padding: 14px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;

    &:hover {
      background-color: #f5f5f5;
    }

    &.active {
      background-color: #e6f4ff;
    }

    .session-content {
      flex: 1;
      display: flex;
      align-items: center;
      gap: 8px;
      overflow: hidden;
      font-size: 15px;

      .el-input {
        margin: -5px 0;
      }
    }

    .session-actions {
      display: flex;
      gap: 8px;
      opacity: 0.7;

      i {
        font-size: 15px;
        cursor: pointer;

        &:hover {
          color: #409EFF;
        }
      }
      i.el-icon-delete {
        color: #e03636;
      }
    }
  }

  .session-list.disabled {
    opacity: 0.6;
    pointer-events: none;
  }

  .new-chat.disabled {
    opacity: 0.6;
    pointer-events: none;
  }
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;

  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 150px;

    .empty-message {
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: #101010;
      margin-top: -50px;
      
      .logo {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
      }

      h3 {
        font-size: 24px;
        font-weight: 550;
        margin-bottom: 0;
        margin-top: 0;
      }

      p {
        font-size: 16px;
        color: #999;
      }
    }
  }

  .message-item {
    display: flex;
    margin-bottom: 20px;
    gap: 8px;
    font-size: 15px;

    .message-box {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-width: calc(100% - 118px);

      &:hover .message-actions {
        display: flex;
      }
    }

    &.user {
      flex-direction: row-reverse;

      .message-box {
        align-items: flex-end;
      }

      .message-content {
        background-color: #409EFF; 
        color: #fff;
      }

      .message-actions {
        flex-direction: row-reverse;
      }

      .el-avatar {
        margin-right: 0;
        margin-left: 12px;
        background: transparent !important;
      }
    }

    &.assistant {
      .el-avatar {
        margin-right: 12px;
        margin-left: 0;
        background: transparent !important;
      }
    }

    .message-content {
      padding: 12px 16px;
      border-radius: 8px;
      background-color: #fff;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      word-break: break-word;
      line-height: 1.5;
      white-space: pre-wrap;

      &.thinking {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 120px;
        
        i {
          font-size: 16px;
        }

        .thinking-text:after {
          content: '...';
          animation: thinking 1.5s infinite;
        }
      }
    }

    .message-actions {
      display: none;
      gap: 12px;
      padding: 24px 12px;
      position: absolute;
      bottom: -35px;
      left: 0;
      height: 24px;
      z-index: 1;

      &:hover {
        display: flex;
      }

      .el-button {
        padding: 0;
        height: 24px;
        
        i {
          font-size: 16px;
          color: #636463;
          font-weight: 550;
          
          &:hover {
            color: #409EFF;
          }
        }
      }
    }
  }

  .generating-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
    color: #909399;
    
    i {
      font-size: 16px;
    }
  }

  .generating-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    color: #909399;
    font-size: 14px;
    
    i {
      font-size: 18px;
    }
  }

  .chat-input {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    min-height: 50px;
    padding: 0 150px;

    .input-actions {
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
    }


    .el-textarea {
      flex: 1;

      .el-textarea__inner {
        max-height: 150px !important;
        padding: 13px 15px;
        resize: none;
        overflow-y: auto;
        line-height: 1.5;
        color: #101010;
      }
    }

    .el-button {
      height: 49px;
      padding: 0 15px;
      margin: 0;

      .el-icon-paperclip, .el-icon-position {
        font-size: 18px;
      }
    }

    .el-button.stop-button {
      background-color: #f56c6c;
      border-color: #f56c6c;
      color: #fff;
      
      &:hover {
        background-color: #f78989;
        border-color: #f78989;
      }
    }
  }
}

@keyframes thinking {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}
